package com.nycreativity.elecreativity.entity.po

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.nycreativity.elecreativity.entity.BaseEntity
import org.springframework.util.ObjectUtils

/**
 * <p>
 *
 * </p>
 *
 * @author sxt && ttxxi
 * @since 2021-03-22
 */
class Goods : BaseEntity() {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    var id: Long? = null

    /**
     * 类型id
     */
    var typeId: Long? = null

    /**
     * 品牌id
     */
    var brandId: Long? = null

    /**
     * 商品名
     */
    var name: String? = null

    /**
     * 商品简介
     */
    var brief: String? = null

    /**
     * 商品描述
     */
    var goodsDesc: String? = null

    /**
     * 商品的属性规格
     */
    var specification: String? = null


    override fun toString(): String {
        return "Goods{" +
                "id=" + id +
                ", typeId=" + typeId +
                ", brandId=" + brandId +
                ", brief=" + brief +
                ", goodsDesc=" + goodsDesc +
                ", specification=" + specification +
                ", ${super.toString()}}"
    }

    fun isEmpty(): Boolean{
        return ObjectUtils.isEmpty(id) && ObjectUtils.isEmpty(typeId) && ObjectUtils.isEmpty(brandId)
                && ObjectUtils.isEmpty(name) && ObjectUtils.isEmpty(brief) && ObjectUtils.isEmpty(goodsDesc)
                && ObjectUtils.isEmpty(specification)
    }
}
